<script setup lang="ts">
import agconnect from '@hw-agconnect/api'
import { useRouter } from 'vue-router'
import { useUserStore } from '@/stores/user'

const userStore = useUserStore()
const router = useRouter()
const logout = async () => {
  await agconnect.auth().signOut()
  userStore.removeToken()
  router.replace('/login')
}
</script>

<template>
  <el-button @click="logout">登出</el-button>
</template>

<style scoped lang="less"></style>
